﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;
using System.Configuration;
using System.Data.SqlClient;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            Type _type = Assembly.LoadFrom("DigDes.DS2012.DislocationLoader.dll").GetType("DigDes.DS2012.DislocationLoader.DisLoader");
            MethodInfo methodInfo = _type.GetMethod("LoadData");

            DirectoryInfo d = new DirectoryInfo(".\\");
            FileInfo[] Files = d.GetFiles();

            var FileName = "";

            for (int i = 0; i < Files.Length; i++)
            {
                FileName = Files[i].Name;

                if (!FileName.EndsWith(".OUT"))
                    continue;

                byte[] Data = File.ReadAllBytes(FileName);

                methodInfo.Invoke(Activator.CreateInstance(_type, null), new object[] { FileName, Data });
            }
        }
    }
}
